# -*- encoding: utf-8 -*-
import sys
from scrapy.crawler import CrawlerProcess
from scrapy.utils.project import get_project_settings
from bitcoin_crawler.spiders.bitcoin import BitcoinSpider

isDev = False

process = CrawlerProcess(get_project_settings())
if isDev:
    process.crawl(BitcoinSpider,
                  start_page=0,
                  end_page=1,
                  coin_name='bitcoin')
else:
    process.crawl(BitcoinSpider,
                  start_page=int(sys.argv[1]),
                  end_page=int(sys.argv[2]),
                  coin_name=str(sys.argv[3]))
process.start()
